package com.ragdollcat.thirdaicodegenerate.core.parse;

import lombok.extern.slf4j.Slf4j;

/**
 * 代码执行器
 */
@Slf4j
public class CodeParserExecutor {

    private static final HtmlCodeParser HTML_CODE_PARSER = new HtmlCodeParser();

    private static final MultiFileCodeParser MULTI_FILE_CODE_PARSER = new MultiFileCodeParser();

    public static Object execute(String bizType, String context) {
        switch (bizType) {
            case "html" -> {
                return HTML_CODE_PARSER.parseCode(context);
            }
            case "multi_file" -> {
                return MULTI_FILE_CODE_PARSER.parseCode(context);
            }
            default -> log.info("当前任务类型:{}，不支持", bizType);
        }
        return null;
    }

}
